package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.ProjectPageVo;
import com.zzyl.serve.domain.NursingProject;
import com.zzyl.serve.service.INursingProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController
@RequestMapping("/member/orders/project")
public class MemberShowProductController extends BaseController {
    @Autowired
    private INursingProjectService nursingProjectService;
    /**
     * 小程序端分页查询护理项目
     * @param nursingProject
     * */
    @GetMapping("/page")
    public TableDataInfo<List<NursingProject>> page(NursingProject nursingProject){
        startPage();
        List<NursingProject> nursingProjects=nursingProjectService.selectNursingProjectList(nursingProject);
        return getDataTable(nursingProjects);
    }
    /**
     * 根据id查询护理项目
     * @param id
     * */
    @GetMapping("/{id}")
    public AjaxResult findById(@PathVariable("id") Long id){
        NursingProject nursingProject=nursingProjectService.selectNursingProjectById(id);
        return success(nursingProject);
    }
}
